package com.xishu.entity.customer;

import com.xishu.annotation.dao.DefaultValue;
import com.xishu.entity.AbstractEntity;
import com.xishu.entity.oplog.OpName;
import com.xishu.entity.shop.DiscountTicket;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 积分商城
 */
@Entity(name = "score_shop")
@Table(indexes = {@Index(columnList = "companyId")})
public class ScoreShop extends AbstractEntity implements OpName {
    @Transient
    private String opName;

    @ApiModelProperty(value = "归属哪一个公司")
    private Long companyId;

    @ApiModelProperty(value = "优惠卷的ID")
    private Long ticketId;

    @ApiModelProperty(value = "积分")
    private Integer score;

    @ApiModelProperty(value = "优惠卷中文名称")
    @Transient
    private String ticketName_zh;

    @ApiModelProperty(value = "优惠卷英文名称")
    @Transient
    private String ticketName_en;

    @ApiModelProperty(value = "优惠卷英文名称")
    private String ticketName;

    @Transient
    @ApiModelProperty(value = "优惠卷")
    private DiscountTicket discountTicket;

    @Transient
    @ApiModelProperty(value = "会员ID")
    private Long customerId;

    @Transient
    @ApiModelProperty(value = "是否已经过期，默认false")
    @DefaultValue(defaultValue = "false")
    private Boolean expired;

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public DiscountTicket getDiscountTicket() {
        return discountTicket;
    }

    public void setDiscountTicket(DiscountTicket discountTicket) {
        this.discountTicket = discountTicket;
    }

    public String getTicketName() {
        return ticketName;
    }

    public void setTicketName(String ticketName) {
        this.ticketName = ticketName;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public Long getTicketId() {
        return ticketId;
    }

    public void setTicketId(Long ticketId) {
        this.ticketId = ticketId;
    }

    public Integer getScore() {
        return score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    public String getTicketName_zh() {
        return ticketName_zh;
    }

    public void setTicketName_zh(String ticketName_zh) {
        this.ticketName_zh = ticketName_zh;
    }

    public String getTicketName_en() {
        return ticketName_en;
    }

    public void setTicketName_en(String ticketName_en) {
        this.ticketName_en = ticketName_en;
    }

    public Boolean getExpired() {
        return expired;
    }

    public void setExpired(Boolean expired) {
        this.expired = expired;
    }

    @Override
    public void setOpName(String str) {
        this.opName = str;
    }

    @Override
    public String getOpName() {
        return opName;
    }

    @Override
    public String opType() {
        return "积分商城";
    }

    @Override
    public String[] fieldName() {
        return new String[]{"companyId", "ticketId"};
    }
}
